#include "libGeoutils/shape/Rectangle.h"

#define MIN_LON_KEY "min_longitude"
#define MAX_LON_KEY "max_longitude"
#define MIN_LAT_KEY "min_latitude"
#define MAX_LAT_KEY "max_latitude"

geo::shape::Rectangle::Rectangle(double minLon, double maxLon, double minLat, double maxLat)
{
	setProperty<double>(MIN_LON_KEY, minLon);
	setProperty<double>(MAX_LON_KEY, maxLon);
	setProperty<double>(MIN_LAT_KEY, minLat);
	setProperty<double>(MAX_LAT_KEY, maxLat);
}

geo::shape::Rectangle::~Rectangle() = default;

void geo::shape::Rectangle::setMinLon(double minLon)
{
	setProperty<double>(MIN_LON_KEY, minLon);
}

double geo::shape::Rectangle::getMinLon() const
{
	double minLon = 0;
	getProperty<double>(MIN_LON_KEY, minLon);
	return minLon;
}

void geo::shape::Rectangle::setMaxLon(double maxLon)
{
	setProperty<double>(MAX_LON_KEY, maxLon);
}

double geo::shape::Rectangle::getMaxLon() const
{
	double maxLon = 0;
	getProperty<double>(MAX_LON_KEY, maxLon);
	return maxLon;
}

void geo::shape::Rectangle::setMinLat(double minLat)
{
	setProperty<double>(MIN_LAT_KEY, minLat);
}

double geo::shape::Rectangle::getMinLat() const
{
	double minLat = 0;
	getProperty<double>(MIN_LAT_KEY, minLat);
	return minLat;
}

void geo::shape::Rectangle::setMaxLat(double maxLat)
{
	setProperty<double>(MAX_LAT_KEY, maxLat);
}

double geo::shape::Rectangle::getMaxLat() const
{
	double maxLat = 0;
	getProperty<double>(MAX_LAT_KEY, maxLat);
	return maxLat;
}
